import App from './App'
import ruiUi from './utils/index.js'
//pinia
import * as Pinia from 'pinia';
import persistPlugin from "./store/persistPlugin.js";

//多语言
import messages from './locale/index'
import {
	createI18n
} from 'vue-i18n'
const i18n = createI18n({
	locale: uni.getLocale(),
	messages
})

import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  //状态管理
  const pinia = Pinia.createPinia()
  pinia.use(persistPlugin)
  app.use(pinia)
  
  //多语言
  app.use(i18n)
  
  //工具
  app.use(ruiUi)
  
  return {
    app
  }
}